﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algorithm.Easy_9_PalindromeNumber
{
    //9.回文数
    class MainProject
    {
        static void Main(string[] args)
        {
            //Console.WriteLine(IsPalindrome(0));
            Console.WriteLine(IsPalindrome(1000021));
            Console.ReadKey();
        }

        public static bool IsPalindrome(int x)//-121
        {
            string str =  x.ToString();
            int verificationCount = str.Length / 2;
            if (verificationCount == 0)
            {
                return true;
            }
            for (int i = 0; i < verificationCount; i++)
            {
                if (str[i] != str[str.Length - 1 - i])
                {
                    return false;
                }
            }
            return true;
        }
    }
}
